import request from "../api/requset.js";

//登录
export const login = (data) => {
  return request.post("/Login/login", data);
};

//用户信息
export const userList = (params) => {
  return request.get("/User/select", { params });
};

//注册新增用户
export const addUser = (data) => {
  return request.post("/Login/register", data);
};

export const updateUser = (data) => {
  return request.post("/User/update", data);
};

//删除用户
export const deleteUser = (data) => {
  return request.post("/User/delete", data);
};
//超级管理员用户修改密码接口
export const updatePassword = (data) => {
  return request.post("/User/updatePassword", data);
};

//用户个人中心修改密码接口
export const UserUpdatePassword = (data) => {
  return request.post("/User/UserUpdatePassword", data);
};

//用户分配角色
export const assignRole = (data) => {
  return request.post("/User/assignRole", data);
};

//上传头像
export const uploadImg = (data) => {
  return request.post("/Index/upload", data);
};

//角色分页
export const RoleList = (params) => {
  return request.get("/Role/select", { params });
};

//角色新增
export const addRole = (data) => {
  return request.post("/Role/add", data);
};

//角色修改
export const updateRole = (data) => {
  return request.post("/Role/update", data);
};

//欢乐跑学生分页
export const Allselect = (params) => {
  return request.get("Role/Allselect", { params });
};

//角色删除接口
export const RoleDelete = (data) => {
  return request.post("/Role/delete", data);
};

//全部菜单接口
export const djSelect = (params) => {
  return request.get("/Menu/djSelect", { params });
};

//全部角色接口
export const AllRole = () => {
  return request.get("/Role/Allselect");
};

//用户已经分配的角色
export const getUserRoles = (params) => {
  return request.get("/User/getUserRole", { params });
};

//角色已经分配的菜单
export const getRoleMenu = (params) => {
  return request.get("/Role/getRoleMenu", { params });
};
//角色分配菜单提交
export const assignMenu = (data) => {
  return request.post("/Role/roleMenu", data);
};

//菜单删除
export const deleteMenu = (data) => {
  return request.post("/Menu/delete", data);
};

//编辑菜单
export const updateMenu = (data) => {
  return request.post("/Menu/update", data);
};

//新增菜单
export const addMenu = (data) => {
  return request.post("/Menu/add", data);
};
